package com.ihr360.oneclick.dto.spreadsheet;

import com.ihr360.commons.model.entity.StringIdWithTime;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 电子表格固定列
 */
@Entity
@Table(name = "tab_spreadsheet_column")
@DynamicUpdate
public class SpreadsheetColumnDto extends StringIdWithTime {

    public static class ColumnType {
        public final static int STRING = 1;
        public final static int NUMB = 2;
        public final static int SELECT = 3;
        public final static int DATE = 4;
    }

    @Column(length = 40, nullable = false)
    private String spreadsheetId;

    @Column(length = 40, nullable = false)
    private String columnFieldMeta;

    /**
     * 用于标志一个列
     */
    @Column(length = 40, nullable = false)
    private String columnFieldName;

    @Column(length = 40, nullable = false)
    private String columnDisplayName;

    /**
     * 获取国际化需要的键
     */
    private String columni8nKey;

    /**
     * 列在表格中的位置
     */
    @Column(length = 16, nullable = false)
    private int columnIndex;

    /**
     * 列的类型
     * todo:// 枚举类型的值如何获取
     */
    @Column(length = 8, nullable = false)
    private int columnType;


    /**
     * 是否是必填列
     */
    @Column(nullable = false, columnDefinition = "tinyint(1) default 1")
    private Boolean required;


    public SpreadsheetColumnDto() {
    }

    public String getSpreadsheetId() {
        return spreadsheetId;
    }

    public void setSpreadsheetId(String spreadsheetId) {
        this.spreadsheetId = spreadsheetId;
    }

    public String getColumnFieldName() {
        return columnFieldName;
    }

    public String getColumnFieldMeta() {
        return columnFieldMeta;
    }

    public void setColumnFieldMeta(String columnFieldMeta) {
        this.columnFieldMeta = columnFieldMeta;
    }

    public void setColumnFieldName(String columnFieldName) {
        this.columnFieldName = columnFieldName;
    }

    public String getColumni8nKey() {
        return columni8nKey;
    }

    public void setColumni8nKey(String columni8nKey) {
        this.columni8nKey = columni8nKey;
    }

    public int getColumnIndex() {
        return columnIndex;
    }

    public void setColumnIndex(int columnIndex) {
        this.columnIndex = columnIndex;
    }

    public int getColumnType() {
        return columnType;
    }

    public void setColumnType(int columnType) {
        this.columnType = columnType;
    }

    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    public String getColumnDisplayName() {
        return columnDisplayName;
    }

    public void setColumnDisplayName(String columnDisplayName) {
        this.columnDisplayName = columnDisplayName;
    }
}